<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- http://hge.relishgames.com -->

<html>

<head>
<meta name="Keywords" content="game engine, 2d, hardware accelerated, hge, engine, relish games, game development">
<meta name="Description" content="Haaf's Game Engine - Hardware accelerated 2D games engine">
<title>Haaf's Game Engine - Hardware accelerated 2D games engine</title>
<link rel=stylesheet type=text/css href=hge.css>
<script language="JavaScript" src="hge.js"></script>
</head>

<body onload="setContents('cnt_hgefunc.html');" bgcolor=#ffffff text=#000000 link=#7F0000 vlink=#7F0000 alink=#7F0000 marginwidth=0 marginheight=0 leftmargin=0 topmargin=0>
<table height=100% cellspacing=0 cellpadding=0 border=0><tr>

<td valign=top>
<table width=566 cellspacing=0 cellpadding=20 border=0><tr><td>
<h1 style="margin-top:0px">HGE::Gfx_RenderLine</h1>
<p>
Renders a line.
</p>
<pre>
void Gfx_RenderLine(
  float <i><b>x1</b></i>,
  float <i><b>y1</b></i>,
  float <i><b>x2</b></i>,
  float <i><b>y2</b></i>,
  DWORD <i><b>color</b></i> = 0xFFFFFFFF,
  float <i><b>z</b></i> = 0.5f
);
</pre>
<h2>Parameters</h2>
<dl>
<dt><i>x1</i>
<dd>Starting point X-coordinate.
<dt><i>y1</i>
<dd>Starting point Y-coordinate.
<dt><i>x2</i>
<dd>Ending point X-coordinate.
<dt><i>y2</i>
<dd>Ending point Y-coordinate.
<dt><i>color</i>
<dd>Optional color value. Default is 0xFFFFFFFF.
<dt><i>z</i>
<dd>Optional Z-order. Default is 0.5f.
</dl>
<h2>Remarks</h2>
<p>
<b>Gfx_RenderLine</b> function must be called between the <a href="hgefunc_gfxbeginscene.html">Gfx_BeginScene</a> and
<a href="hgefunc_gfxendscene.html">Gfx_EndScene</a> calls.
<br><br>
<b>Gfx_RenderLine</b> omits the last point of the line, so you can draw joint
lines without any additional coordinates adjustments.
The color parameter includes alpha value. See the
<a href="hgedata_hwcolor.html">Hardware color format</a> section for details.
If Z-buffer isn't used, the Z-order value is ignored.
<br><br>
For performance reasons <b>Gfx_RenderLine</b> accumulates consecutive lines
and then renders them with a single call to <b>DirectX</b>.
In most cases you will not see any difference and don't have to deal with this
batching at all. But to be sure and safe it is recommended to group your graphics 
by primitive type and render as much lines as possible at once.
</p>
<h2>Requirements</h2>
<p>
<b>Header:</b> hge.h<br>
<b>Import library:</b> hge.lib
</p>
<h2>See also</h2>
<p>
<a href="hgefunc_gfxbeginscene.html">Gfx_BeginScene</a>,
<a href="hgefunc_gfxendscene.html">Gfx_EndScene</a>
</p>
<br>
</td></tr></table>
</td>

</tr></table>
</body>

</html>